<template>
	<view class="container">
		<view class="index_dialog" v-if="isShwoDialog">
			<image :src="floatImgList.thumb" mode="" class="dialog"></image>
			<image src="@/static/image/down.png" mode="" class="down" @click="isShwoDialog = false"></image>
		</view>
		<swiper :autoplay="true" :interval="3000" :duration="1000" class="banner-swiper">
			<swiper-item v-for="item in bannerList">
				<image :src="item.thumb" mode="" class="banner_image"></image>
			</swiper-item>
		</swiper>
		<view class="group-menu">
			<navigator url="Popular/Popular_index">
				<view class="group-menu-item">
					<image class="group-menu-item-icon" src="@/static/image/Frame.png"></image>
					<view class="group-menu-item-text">热改楼盘</view>
				</view>
			</navigator>
			<navigator url="check_in">
				<view class="group-menu-item">
					<image class="group-menu-item-icon" src="@/static/image/Frame_1.png"></image>
					<view class="group-menu-item-text">拎包入住</view>
				</view>
			</navigator>
			<navigator url="work_list">
				<view class="group-menu-item">
					<image class="group-menu-item-icon" src="@/static/image/Frame_2.png"></image>
					<view class="group-menu-item-text">工地实景</view>
				</view>
			</navigator>
			<view class="group-menu-item">
				<image class="group-menu-item-icon" src="@/static/image/Frame_3.png"></image>
				<view class="group-menu-item-text">保洁阿姨</view>
			</view>
		</view>
		<uni-section title="热改楼盘" type="" subTitl="更多  >">
			<template v-slot:decoration>
				<view class="line"></view>
			</template>
			<template v-slot:right>
				<navigator url="Popular/Popular_index" hover-class="navigator-hover">
					<view class="handbag-header-right">
						更多
					</view>
				</navigator>
			</template>
			<view class="building-list-content">
				<view class="building-item-content" v-for="(item,index) in buildList">
					<navigator :url="'Popular/floor?id='+item.id">
						<image class="building-item-image" :src="item.thumb">
						</image>
						<view class="building-item-mark">
							<view class="building-item-title">{{item.name}}</view>
							<view class="building-item-desc">{{item.model.name+'/'+item.style.name}}</view>
						</view>
					</navigator> 
				</view>
			</view>
		</uni-section>
		<uni-section title="拎包入住" type="">
			<template v-slot:decoration>
				<view class="line"></view>
			</template>
			<template v-slot:right>
				<navigator url="check_in" hover-class="navigator-hover">
					<view class="handbag-header-right">
						更多
					</view>
				</navigator>
			</template>
			<view class="handbag-list-content">
				<view class="handbag-item-content" v-for="(item,index) in comboList">
					<image class="handbag-item-image" :src="item.thumb">
					</image>
					<view class="handbag-item-mark">
						<view class="handbag-item-title">{{item.name}}</view>
						<view class="handbag-item-desc">{{item.model}}m²</view>
						<view class="handbag-item-two">{{item.desc_str}}</view>
					</view>
				</view>
			</view>
		</uni-section>
		<uni-section title="工地实景" type="">
			<template v-slot:decoration>
				<view class="line"></view>
			</template>
			<template v-slot:right>
				<navigator url="work_list">
					<view class="handbag-header-right">
						更多
					</view>
				</navigator>
			</template>
			<view class="work-list-content">
				<view class="work-item-content" v-for="(item,index) in constructionList" :key="index">
					<navigator :url="'work_details/work_details?id='+item.id">
						<image class="work-item-image" :src="item.thumb">
						</image>
						<view class="work-item-mark">
							<view class="work-item-title">{{item.name}}</view>
						</view>
					</navigator>
				</view>
			</view>
		</uni-section>
		<view class="float-image" v-if="floatimage" @click="isHowimage">
			<image src="../../static/image/index/zixun.png" class="float-image-consult"></image>
		</view>
		<view class="float_view" v-else>
			<view class="handbag-header">
				<view class="handbag-header-left">
					<view class="line"></view> 联系方式
				</view>
				<image src="@/static/image/index/close.png" mode="" class="handbag-header-image" @click="isHowimage" s>
				</image>
			</view>
			<view class="horizontal"></view>
			<view class="float_view_one">
				<view class="float_view_two">
					<image src="@/static/image/index/icon.png" mode="" class="float_view_two_img"></image>
					<view class="float_view_two_view">14865978215</view>
				</view>
				<view class="float_view_two">
					<image src="@/static/image/index/icon _2.png" mode="" class="float_view_two_img"></image>
					<view class="float_view_two_view">14865978215</view>
				</view>
				<view class="float_view_two">
					<image src="@/static/image/index/icon _3.png" mode="" class="float_view_two_img"></image>
					<view class="float_view_two_view">14865978215</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				href: 'https://uniapp.dcloud.io/component/README?id=uniui',
				isShwoDialog: true,
				floatimage: true,
				bannerList: [],
				floatImgList: '',

				buildList: [], //热改楼盘
				comboList: [], //拎包入住
				constructionList: []
			}
		},
		methods: {
			PageData() {
				this.$http.post('/system/getBaseInfo').then(res => {

					this.bannerList = res.data.data.bannerList
					this.floatImgList = res.data.data.floatImgList[0]
					console.log(this.floatimage);
				})
				this.$http.post('/system/getIndexData').then(res => {
					this.buildList = this.bannerList = res.data.data.buildList
					this.comboList = this.bannerList = res.data.data.comboList
					this.constructionList = this.bannerList = res.data.data.constructionList
					console.log(res);
				})
			},
			isHowimage() {
				this.floatimage = !this.floatimage
			},
			
		},
		onLoad() {
			this.PageData()
		}
	}
</script>

<style lang="scss" scoped>
	::-webkit-scrollbar {
		width: 0;
	}

	* {
		margin: 0 auto;
		padding: 0 0;
	}

	.line {
		width: 6rpx;
		height: 28rpx;
		background: #3d9c36;
		margin-right: 20rpx;
	}

	.handbag-header-right {
		font-size: 24rpx;
		font-weight: 500;
		color: #333333;
		line-height: 24rpx;
	}

	.handbag-header-right::after {
		content: ">";
		margin-left: 10rpx;
		margin-right: 45rpx;
	}

	.container {
		width: 100%;
		height: 100vh;
		background: #f5f5f5;
		padding-bottom: 112rpx;

		.banner-swiper {
			width: 100%;
			height: 450rpx;
		}

		.index_dialog {
			position: fixed;
			width: 100%;
			height: 100vh;
			background: rgba(0, 0, 0, 0.5);
			z-index: 999; //平面高度
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;

			.dialog {
				width: 542rpx;
				height: 724rpx;
			}

			.down {
				padding-top: 80rpx;
				width: 80rpx;
				height: 80rpx;
			}
		}

		.banner_image {
			width: 750rpx;
			height: 450rpx;
			background: #d9d9d9;
		}

		.group-menu {
			box-sizing: border-box;
			padding: 40rpx 52rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.group-menu-item {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				.group-menu-item-icon {
					width: 80rpx;
					height: 80rpx;
				}

				.group-menu-item-text {
					width: 96rpx;
					height: 34rpx;
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					font-weight: 500;
					text-align: CENTER;
					color: #333333;
					line-height: 24rpx;
				}
			}
		}

		//uni-section
		.building-list-content {
			box-sizing: border-box;
			overflow-x: scroll;
			margin-top: 20rpx;
			display: flex;
			padding-left: 40rpx;

			/* 改变图片条慕为水平方向 */
			.building-item-content {
				width: 382rpx;
				height: 510rpx;
				margin-right: 40rpx;
				position: relative;

				.building-item-image {
					width: 382rpx;
					height: 510rpx;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
				}

				.building-item-mark {
					position: absolute; //子元素使用 absolute 父元素必须为相对定位 否则它"丢"了
					bottom: 0rpx;
					left: 0px;
					width: 382rpx;
					height: 94rpx;
					background: rgba(0, 0, 0, .3);
					border-radius: 16rpx 16rpx 16rpx 16rpx;
					box-sizing: border-box;
					padding: 12rpx 24rpx;

					.building-item-title {
						font-size: 24rpx;
						font-weight: 700;
						color: #ffffff;
						line-height: 24rpx;
					}

					.building-item-desc {
						font-size: 20rpx;
						font-weight: 700;
						color: rgba(255, 255, 255, 0.8);
						line-height: 20rpx;
						margin-top: 20rpx;
					}
				}
			}
		}

		.handbag-list-content {
			box-sizing: border-box;
			overflow-x: scroll;
			margin-top: 20rpx;
			display: flex;
			padding-left: 40rpx;

			/* 改变图片条慕为水平方向 */
			.handbag-item-content {
				width: 382rpx;
				height: 510rpx;
				margin-right: 40rpx;
				position: relative;

				.handbag-item-image {
					width: 382rpx;
					height: 510rpx;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
				}

				.handbag-item-mark {
					position: absolute; //子元素使用 absolute 父元素必须为相对定位 否则它"丢"了
					bottom: 0px;
					left: 0px;
					width: 382rpx;
					height: 164rpx;
					background: rgba(0, 0, 0, .3);
					border-radius: 16rpx 16rpx 16rpx 16rpx;
					box-sizing: border-box;
					padding: 12rpx 24rpx;

					.handbag-item-title {
						font-size: 24rpx;
						font-weight: 700;
						color: #ffffff;
						line-height: 24rpx;
					}

					.handbag-item-desc {
						font-size: 20rpx;
						font-weight: 700;
						color: rgba(255, 255, 255, 0.8);
						line-height: 20rpx;
						margin-top: 20rpx;
					}

					.handbag-item-two {
						margin-top: 20rpx;
						font-size: 20rpx;
						text-align: LEFT;
						color: rgba(255, 255, 255, 0.8);
						line-height: 30rpx;
					}
				}
			}
		}

		.work-list-content {
			box-sizing: border-box;
			overflow-x: scroll;
			margin-top: 40rpx;
			display: flex;
			padding-bottom: 112rpx;

			/* 改变图片条慕为水平方向 */
			.work-item-content {
				margin-right: 40rpx;
				position: relative;

				.work-item-image {
					width: 520rpx;
					height: 312rpx;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
				}

				.work-item-mark {
					position: absolute; //子元素使用 absolute 父元素必须为相对定位 否则它"丢"了
					bottom: 5px;
					left: 0px;
					background: rgba(0, 0, 0, .3);
					border-radius: 0rpx 0rpx 16rpx 16rpx;
					box-sizing: border-box;
					padding: 12rpx 24rpx;
					width: 520rpx;
					height: 66rpx;

					.work-item-title {
						font-size: 24rpx;
						font-weight: 700;
						color: #ffffff;
						line-height: 24rpx;
						text-align: center;
					}
				}
			}
		}

		.float_view {
			width: 362rpx;
			height: 332rpx;
			background: rgba(255, 255, 255, 0.80);
			border-radius: 12rpx;
			box-shadow: -4rpx 4rpx 4rpx 0rpx rgba(0, 0, 0, 0.15);
			backdrop-filter: blur(4rpx);
			position: fixed;
			z-index: 333;
			bottom: 20rpx;
			right: 20rpx;
			margin-bottom: 80rpx;

			.handbag-header {
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-top: 28rpx;
				margin-left: 20rpx;
				margin-right: 20rpx;

				.handbag-header-left {
					font-size: 28rpx;
					color: #333333;
					line-height: 28rpx;
					display: flex;
					align-items: center;

					.line {
						width: 6rpx;
						height: 28rpx;
						background: #3d9c36;
						margin-right: 10rpx;

					}
				}

				.handbag-header-image {
					width: 44rpx;
					height: 44rpx;
					padding-right: 40rpx;
				}
			}

			.horizontal {
				margin-top: 20rpx;
				border-bottom: 1px solid black;
				// width: 362rpx;
				// height: 1rpx;
				// background: black;
			}

			.float_view_one {
				margin-top: 34rpx;

				.float_view_two {
					margin-top: 20rpx;
					display: flex;
					flex-direction: row;
					justify-content: center;
					align-items: center;

					.float_view_two_img {
						width: 38rpx;
						height: 34rpx;
						margin-right: 40rpx;
					}

					.float_view_two_view {
						width: 186rpx;
						height: 40rpx;
						font-size: 28rpx;
						text-align: CENTER;
						line-height: 40rpx;

					}
				}
			}
		}

		.float-image {
			position: fixed;
			z-index: 333;
			bottom: 133rpx;
			right: 20rpx;

			.float-image-consult {
				width: 182rpx;
				height: 222rpx;
			}
		}
	}
</style>
